package com.zeng.sys.authmd.restfulmodule.util;

import com.zeng.sys.authmd.apimodule.vo.UserVo;

import java.util.HashMap;
import java.util.Map;

public class JwtUtil {
    private static Map<String, UserVo> loginMap = new HashMap<>();

    public static Map getLoginUser(String token) {
        return loginMap;
    }

    public static void addLoginUser(String token, UserVo user) {
        loginMap.put(token, user);
    }

    public void cleanExpire() {
        for (String s : loginMap.keySet()) {
            if (loginMap.get(s).getExpireTime().getTime() < System.currentTimeMillis()) {
                loginMap.remove(s);
            }
        }
    }

}
